package com.juc.learn.reviewsynchronized_1;

/**
 * ClassName:SaleTicket
 * Package:com.juc.learn.reviewsynchronized_1
 * Description:
 *
 * @Author:@郭先森
 * @Create:2025/7/26 - 10:32
 * @Version:v1.0
 */
public class SaleTicket {
    private int num = 30;
    public synchronized void sale(){
        if(num>0){
            System.out.println(Thread.currentThread().getName()+"卖出了第"+num--+"张票");
        }
    }
}
